3.2.9 \(\int \frac {\sec ^3(c+d x)}{a+i a \tan (c+d x)} \, dx\) [109]

Optimal. Leaf size=31 \[ \frac {\tanh ^{-1}(\sin (c+d x))}{a d}-\frac {i \sec (c+d x)}{a d} \]

[Out]

arctanh(sin(d*x+c))/a/d-I*sec(d*x+c)/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3582, 3855} \begin {gather*} \frac {\tanh ^{-1}(\sin (c+d x))}{a d}-\frac {i \sec (c+d x)}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

ArcTanh[Sin[c + d*x]]/(a*d) - (I*Sec[c + d*x])/(a*d)

Rule 3582

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[d^2*(
d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + f*x])^(n + 1)/(b*f*(m + n - 1))), x] + Dist[d^2*((m - 2)/(a*(m + n - 1
))), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2
 + b^2, 0] && LtQ[n, 0] && GtQ[m, 1] &&  !ILtQ[m + n, 0] && NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\sec ^3(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {i \sec (c+d x)}{a d}+\frac {\int \sec (c+d x) \, dx}{a}\\ &=\frac {\tanh ^{-1}(\sin (c+d x))}{a d}-\frac {i \sec (c+d x)}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.19, size = 34, normalized size = 1.10 \begin {gather*} \frac {2 \tanh ^{-1}\left (\sin (c)+\cos (c) \tan \left (\frac {d x}{2}\right )\right )-i \sec (c+d x)}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

(2*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x)/2]] - I*Sec[c + d*x])/(a*d)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (30 ) = 60\).
time = 0.53, size = 70, normalized size = 2.26

method result size
derivativedivides \(\frac {\frac {2 i}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2}-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {i}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) \(70\)
default \(\frac {\frac {2 i}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2}-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {i}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d a}\) \(70\)
risch \(-\frac {2 i {\mathrm e}^{i \left (d x +c \right )}}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a d}\) \(74\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^3/(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/d/a*(1/2*I/(tan(1/2*d*x+1/2*c)-1)-1/2*ln(tan(1/2*d*x+1/2*c)-1)-1/2*I/(tan(1/2*d*x+1/2*c)+1)+1/2*ln(tan(1/2*d
*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (29) = 58\).
time = 0.30, size = 83, normalized size = 2.68 \begin {gather*} \frac {\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {2}{-i \, a + \frac {i \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a - 2/(-I*a + I*a*sin(d
*x + c)^2/(cos(d*x + c) + 1)^2))/d

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 80 vs. \(2 (29) = 58\).
time = 0.37, size = 80, normalized size = 2.58 \begin {gather*} \frac {{\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - {\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 2 i \, e^{\left (i \, d x + i \, c\right )}}{a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

((e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) + I) - (e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) - I) - 2*I
*e^(I*d*x + I*c))/(a*d*e^(2*I*d*x + 2*I*c) + a*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \int \frac {\sec ^{3}{\left (c + d x \right )}}{\tan {\left (c + d x \right )} - i}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**3/(a+I*a*tan(d*x+c)),x)

[Out]

-I*Integral(sec(c + d*x)**3/(tan(c + d*x) - I), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.56, size = 58, normalized size = 1.87 \begin {gather*} \frac {\frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a} - \frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a} + \frac {2 i}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

(log(tan(1/2*d*x + 1/2*c) + 1)/a - log(tan(1/2*d*x + 1/2*c) - 1)/a + 2*I/((tan(1/2*d*x + 1/2*c)^2 - 1)*a))/d

________________________________________________________________________________________

Mupad [B]
time = 3.44, size = 43, normalized size = 1.39 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {2{}\mathrm {i}}{a\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^3*(a + a*tan(c + d*x)*1i)),x)

[Out]

(2*atanh(tan(c/2 + (d*x)/2)))/(a*d) + 2i/(a*d*(tan(c/2 + (d*x)/2)^2 - 1))

________________________________________________________________________________________